package cn.xyinping.hrm.feign;

import cn.xyinping.hrm.domain.Login;
import cn.xyinping.hrm.dto.LoginMealDto;
import cn.xyinping.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author 27266
 * @desrciption feign接口 调用认证中心
 * @date 2021/11/22
 */
// 要扫描的服务名， 降级类
@FeignClient(value = "server-auth", fallbackFactory = LoginFeignClientFallback.class)
@RequestMapping("/login")
public interface LoginFeign {
    // 保存一个login
    @RequestMapping(value="/save",method= RequestMethod.POST)
    AjaxResult save(@RequestBody Login login);

    @RequestMapping(value="/saveLoginAndMeal",method= RequestMethod.POST)
    AjaxResult saveLoginAndMeal(@RequestBody LoginMealDto loginMeal);

}
